home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
surfmodl
/
surfm203.arc
/
SURFSRC.ARC
/
WRITEINI.INC
< prev
Wrap
Text File
|
1987-01-12
|
2KB
|
65 lines
procedure WRITEINI;
{ Write the current settings into the INI file }
var Outfile: text; { file to write to }
Notopen: boolean; { flag file not open yet }
Ans: char; { answer to user query }
Mat: integer; { material # }
Lite: integer; { light source # }
begin
assign (Outfile, Inifile);
Notopen := TRUE;
while (Notopen) do begin
{$I-}
rewrite (Outfile);
{$I+}
if (ioresult = 0) then
Notopen := FALSE
else begin
writeln ('Error writing file ', Inifile);
write ('Try again (Y/N)? ');
readln (Ans);
if (Ans = 'N') or (Ans = 'n') then
exit;
end; { if ioresult }
end; { while }
writeln (Outfile, 4); { version number of INI file }
writeln (Outfile, 1, ' ', GrSys + Grmode / 100.0);
writeln (Outfile, 2, ' ', Xeye, ' ', Yeye, ' ', Zeye);
writeln (Outfile, 3, ' ', Xfocal, ' ', Yfocal, ' ', Zfocal);
writeln (Outfile, 4, ' ', Magnify);
writeln (Outfile, 5, ' ', Viewtype);
{ 6: Autoresolve removed }
for Mat := 1 to Nmatl do
writeln (Outfile, 7, ' ',Mat, ' ',R1[Mat],' ', R2[Mat],' ', R3[Mat], ' ',
Color[Mat], ' ',Ambient[Mat]);
for Lite := 1 to Nlite do
writeln (Outfile, 8, ' ',Lite, ' ', Xlite[Lite], ' ', Ylite[Lite], ' ',
Zlite[Lite], ' ',Intensity[Lite]);
{ writeln (Outfile, 9, Ambient); }
if (Interpolate) then
writeln (Outfile, 10, ' ', Epsilon)
else
writeln (Outfile, 10, ' ', 0.0);
if (Shadowing) then
writeln (Outfile, 11, ' ',1)
else
writeln (Outfile, 11, ' ',0);
writeln (Outfile, 12, ' ', Ngraphchar);
writeln (Outfile, 13, ' ', Showaxes, ' ', Xaxislen, ' ', Yaxislen, ' ',
Zaxislen,' ', Axiscolor);
writeln (Outfile, 14, ' ', Nwindow);
if (Mono) then
writeln (Outfile, 15, ' ',Ncolors,' ', 1)
else
writeln (Outfile, 15, ' ',Ncolors,' ', 0);
if (Dorandom) then
writeln (Outfile, 16, ' ', Randshade)
else
writeln (Outfile, 16, ' ',0.0);
writeln (Outfile, 99);
close (Outfile);
end; { procedure WRITEINI }